<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
	String id = request.getParameter("pid") == null ? "0" : (String) request.getParameter("pid");
%>
<%@ include file="../../../taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<base href="<%=basePath%>" />
<%@ include file="/webmodules/console/css.jsp"%>
<%@ include file="/webmodules/console/js.jsp"%>
<script type="text/javascript">
$(function(){
	 $('#myuserdatagrid').datagrid({  
		    url:'dragon/modules/system/user/action/UserHandler/noOrgUserList.ejw',  
		    pagination:true,
		    pageSize: 15,
	        pageList: [10,15,20],
	       	loadMsg:'正在下载数据，请稍后！',
		    remoteSort:false,
		    rownumbers:true,
		    columns:[[  
	    		{field:'ID',title:'ID',width:100, checkbox:'true'},
		        {field:'LOGINNAME',title:'登录名',width:180},
		        {field:'USERNAME',title:'姓名',width:180}, 
		        {field:'STATE',title:'状态',width:150,sortable:true,formatter:function(val){if(val=='1'){return '正常';}else{return "<font color='red'>停用</font>";}}} 
		    ]]  ,
		    toolbar:[{
				text:'保存',
				iconCls:'icon-save',
				handler:function(){
					var d = $('#myuserdatagrid').datagrid('getSelections');
					var ids = "";
					for(i=0;i<d.length;i++){
						ids = ids+d[i].ID+",";
					}
					$.post("dragon/modules/system/user/action/UserHandler/linkOrg.ejw",{ids:ids,org:top.$('#tabsconetnt').tabs('getSelected').find('iframe')[0].contentWindow.$('#slave_${param.bizcode}').find('iframe')[0].contentWindow.$("#ORG").val()},function(data){
						if(data.result !=undefined && data.result == true){
							top.$('#tabsconetnt').tabs('getSelected').find('iframe')[0].contentWindow.$('#slave_${param.bizcode}').find('iframe')[0].contentWindow.$('#mydatagrid').datagrid('reload');
							top.closeWindow();
						}
						if(data.MESSAGE_ERROR != undefined && data.MESSAGE_ERROR != ''){
							top.showMsg("错误", data.MESSAGE_ERROR, true,'error');
						}else if(data.MESSAGE_WARNING != undefined && data.MESSAGE_WARNING != ''){
							top.showMsg("警告", data.MESSAGE_WARNING, true,'warning');
						}else if(data.MESSAGE_INFO != undefined && data.MESSAGE_INFO != ''){
							top.showMsg("", data.MESSAGE_INFO, false);
						}
					},'json');
				}
			}
			]
		});
		var p2 = $('#myuserdatagrid').datagrid('getPager');  
	    $(p2).pagination({  
	        beforePageText: '第',
	        afterPageText: '页    共 {pages} 页',  
	        displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录'   
	    }); 
});
    </script>
</head>
<body>
    <div style="height: 99%"><table  id="myuserdatagrid" fit="true"  ></table></div>
    
</body>
</html>
